package com.lmm.lcbusiness.lcbusiness.pages.rnpages.plugins;

import com.facebook.react.bridge.Callback;
import com.lmm.dresswisdom.lmmframe.reactnative.BasePlugin;
import com.lmm.dresswisdom.lmmframe.reactnative.annotation.RNPlugin;
import com.lmm.lcbusiness.lcbusiness.pages.rnpages.ReactNativeActivity;

import java.util.Map;

/**
 * Created by xmgong on 2017/12/4.
 */
@RNPlugin(method = "showloading")
public class ShowLoadingPlugin extends BasePlugin<ReactNativeActivity> {
    public ShowLoadingPlugin(ReactNativeActivity act) {
        super(act);
    }

    @Override
    protected void doAction(Map<String, Object> map, Callback callback) {
       if (activity != null){
           activity.runOnUiThread(new Runnable() {
               @Override
               public void run() {
                   activity.showDefaultDialog();
               }
           });
       }
    }
}
